package com.macro.douyinpay;

import com.macro.douyinpay.utils.AutoUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;

/**
 * @ClassName：TestController
 * @Author: MACRO
 * @Date: 2024/9/13 0:04
 * @Description: TODO
 */
@RestController
public class TestController {

    @GetMapping("/test")
    public String testMethod() {
        return "Hello, this is a test response!";
    }
    @GetMapping("/start")
    public void start() throws InterruptedException {
        //加载驱动
        AutoUtil.loadDriver();
    }
    @GetMapping("/saveAllCookies")
    public void saveAllCookies()  {
        //加载驱动
        AutoUtil.saveAllCookies();
    }
    @GetMapping("/initDir")
    public void initDir()  {
        //获取resources下面chrome-win64的文件
        String path = this.getClass().getResource("/chrome-win64").getPath();
        System.out.println(path);
        File file = new File("");
        System.out.println(file.getAbsolutePath());

    }

}